import {post_json,get,post} from '../../http/axios'
export default{
    namespaced:true,
    state:{
        fiveCategoryData:[],
        fourProductData:[]
    },
    getters:{},
    mutations:{
        setCategoryData(state,data){
            state.fiveCategoryData = data
        },
        setProductData(state,data){
            state.fourProductData = data
        }
    },
    actions:{
        async toLoadCategory(context,params){
            let res = await post('/category/query',params)
            context.commit('setCategoryData',res.data.list)
        },
        async toLoadProduct(context,params){
            let res = await post('/product/query',params)
            context.commit('setProductData',res.data.list)
        }
    }
}